package  
{
	/**
	 * ...
	 * @author Bryan Keiren & Sander van Katwijk
	 */
	public class Util 
	{
		// Doesn't work.
		static public function countOccurences(str:String, char:String):Number
		{
			var count:Number = 0;
			for (var i:int = 0; i < str.length; ++i) 
				if (str.charAt(i) == char)
					++count;
			return count;
		}
		
		// Tests whether a string starts with the given string.
		static public function strStartsWith(a_String:String, a_Start:String):Boolean
		{
			if (a_Start.length > a_String.length) return false;
			
			for (var i:int = 0; i < a_Start.length; ++i)
			{
				if (a_String.charAt(i) != a_Start.charAt(i))
				{
					return false;
				}
			}
			return true;
		}
		
	}

}